package com.acme.bankapp.domain.bank.listeners;

import com.acme.bankapp.domain.bank.Client;
import com.acme.bankapp.domain.bank.EMail;
import com.acme.bankapp.service.bank.EMailService;

/**
 * Sends e-mail when client is added 
 * @author Artem Nikitin
 *
 */
public class EmailNotificationListener implements ClientRegistrationListener {

	private EMailService mailService; 
	
	public EmailNotificationListener(EMailService mailService) {
		this.mailService = mailService;
	}

	public void onClientAdded(Client client) {
		mailService.sendMail(new EMail(client, "address"));
	}

}
